import axios from "axios"

// 引入get post模块
import { GET, POST } from "./config"
const instance = axios.create({
    baseURL: 'https://api.it120.cc/small4',
    // 请求超时时长
    timeout: 10000,
});

// 请求得到数据返回给页面
export function respust(method, url, params) {
    switch (method) {
        case GET:
            return get(url, params)
        case POST:
            return post(url, params)
    }
}

function get(url, params) {
    return instance.get(url, params)
}
function post(url, params) {
    return instance.post(url, params)
}

